home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Sherlock 2.0
/
Mac v2.0 docs
/
Text Docs
/
Mac SPP Reference .txt
< prev
next >
Wrap
Text File
|
1996-04-05
|
6KB
|
310 lines
Macintosh SPP Reference
SPP copies an input file to an output file, inserting Sherlock macros as it does so. Several options
vary the kind of macros output that SPP inserts. These options are discussed in detail below.
SPP handles all styles of C syntax, from K&R to ANSI C Standard. SPP will place correct
macros in the appropriate locations in spite of most syntax errors. However, I recommend that
you use SPP only on syntactically correct files.
The Macintosh version of SPP gets its arguments from a file call SPP_args, which must be in the
same folder as the SDIF application. See the supplied copy of SPP_args for an example.
SPP will insert no macros in any function containing an FTAG, FTAGV, SL_NAME, or
SL_DISABLE macro. The SL_ENABLE macros forces SPP to insert macros into a function.
SPP warns about functions that do not return a value and are not explicitly declared void.
SPP issues the warning, “Macro found where entry macro should be,” if SPP finds a macro call
where the first executable statement of a function is expected. In such cases, SPP will skip the
generation of an entry macro, i.e., TICKB or TRACEPB. Instead, SPP assumes the macro starts
executable code.
Usage
spp2 [options] in out
Options preceding the name of an input_file apply to that file and to all succeeding files unless
over-written by later options.
Options
+-d id=string // define a constant
Define id to be string, as if the statement #define id string appeared at the start of the program. A
space must separate –d and id, but no space may appear in string or around the equal sign. The
string is optional, in which case the equal sign can be omitted. Examples:
-d STDC=1
-d SHERLOCK
+-exxx // Use exxx routines (default)
Cause SPP to output the exxx family of routines in tracing statements. This option is the default
unless overridden by one of the following options: printf, sl_fmt, tick or usr.
+-ftag // generate FTAG macros
Generate FTAG macros. This option is on by default.
+–f <file name> // use synonym file
Use alternate macro names instead of standard macro names. The named file contains a list of
synonym lines. Each line contains two macro names, a standard name and a synonym. The pound
character (#) starts a comment which continues to the end of the line. An example synonym file:
#synonym file: May 20, 1988
TICKB tickb
TICKX tickx
SL_DUMP dump
+–i // Insert #include <sl.h>
Insert the line #include <sl.h> at the start of the output file.
+–n // Allow nested comments
Allow nested comments. By default, comments do not nest.
+-of <name> // Specify output file
Specify the name of the output file. This option must appear on the command line before the name
of the input file.
+-printf // Use printf routines
Output printf statements inside tracing macros.
+-return // Insert RETURN_xxx macros
Replace return statements by RETURN_XXX macros. This option is obsolete and is included
only for backward compatibility. Its use is discouraged.
+-sl_fmt // Use sl_fmt routines
Output sl_fmt statements inside tracing macros. This option is obsolete and is included only for
backward compatibility. Its use is discouraged.
+-s <path> // Look for include files in path
Add <path> to the list of paths used to search for include files. More than one –s option may be
used. A space must separate –s and <path>. Example:
-s \usr\include
-s \sources
-s \sherlock
+-tick // Insert tick-style macros
This option suppresses entry and exit macros. Only TICK macros are generated.
+-usr // Use usr output routines
Output sl_cout and related support routines inside tracing macros. This option is obsolete and is
included only for backward compatibility. Its use is discouraged.
+-u id // Undefine a preprocessor constant
Undefine id, as if the statement #undef id appeared at the start of the program. A space must
separate –u and id.
+-v // Verbose output
Enable verbose output from SPP. All such output goes to the log window.
+-x // Allow single-line comments
Allow single-line comments. This option is on by default.
+-? // Print the version number and exit
Examples
The following examples assume that the input to SPP is as follows:
int example(char * s, double d)
{
int i;
i = 25;
return i;
}
The default output from SPP will be:
int example(char * s, double)
{
FTAG("example");
int i;
TRACEPB(ftag, es(s); ecs(); edouble(d); enl());
i = 25;
TRACEPX(ftag, eret(); eint(i); enl());
return i;
}
With the +printf option, the output will be:
int example(char * s, double d)
{
FTAG("example");
int i;
TRACEPB(ftag, printf("(%s, %f)\n", s, d));
i = 25;
STATX(ftag);
return i;
}
With both the +printf and +return options enabled, the output will be:
int example(char * s, double d)
{
FTAG("example");
int i;
TRACEPB(ftag, printf("(%s, %f)\n", s, d));
i = 25;
RETURN_INT(ftag, i);
}
With the +tick options the output will be:
int example(char * s, double d)
{
FTAG("example");
int i;
TRACEP(ftag, es(s); ecs(); edouble(d); enl());
i = 25;
return i;
}
With the +usr option the output will be:
int example(char * s, double d)
{
FTAG("example");
int i;
TRACEPB(ftag,
sl_cout('(');
sl_sout(string); sl_sout(", ");
sl_dout(d); sl_sout(")\n"));
i = 25;
STATX(ftag);
return i;
}